home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
ipchat1a
/
frmmain.frm
next >
Wrap
Text File
|
1999-10-03
|
12KB
|
377 lines
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "IP Chat"
ClientHeight = 3180
ClientLeft = 45
ClientTop = 330
ClientWidth = 4380
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3180
ScaleWidth = 4380
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdConnect
Caption = "Connect"
Height = 415
Left = 3390
TabIndex = 13
Top = 2420
Width = 975
End
Begin MSWinsockLib.Winsock sckConnect
Left = 3480
Top = 2760
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.TextBox txtIP
Height = 285
Left = 1960
TabIndex = 12
Text = "localhost"
Top = 2880
Width = 1415
End
Begin VB.TextBox txtPort
Height = 285
Left = 440
TabIndex = 10
Text = "400"
Top = 2880
Width = 1215
End
Begin VB.OptionButton optHostGuest
Caption = "Guest"
Height = 195
Index = 1
Left = 2520
TabIndex = 8
Top = 2520
Value = -1 'True
Width = 735
End
Begin VB.OptionButton optHostGuest
Caption = "Host"
Height = 195
Index = 0
Left = 1800
TabIndex = 7
Top = 2520
Width = 735
End
Begin VB.TextBox txtNick
Height = 285
Left = 440
TabIndex = 6
Text = "NickName"
Top = 2460
Width = 1215
End
Begin VB.CommandButton cmdSend
Caption = "Send"
Height = 300
Left = 3600
TabIndex = 4
Top = 1990
Width = 735
End
Begin VB.TextBox txtText
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 80
TabIndex = 3
Top = 1990
Width = 3495
End
Begin VB.Frame frmeSep
Height = 135
Left = 0
TabIndex = 2
Top = 2280
Width = 4385
End
Begin VB.TextBox txtChat
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1660
Left = 80
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 190
Width = 4215
End
Begin VB.Frame frmeChatWindow
Caption = "Chat Window"
Height = 1935
Left = 0
TabIndex = 0
Top = 0
Width = 4365
End
Begin VB.Shape shpGreen
BackColor = &H00008000&
BackStyle = 1 'Opaque
BorderColor = &H00008000&
Height = 255
Left = 3960
Shape = 3 'Circle
Top = 2880
Width = 255
End
Begin VB.Shape shpRed
BackColor = &H000000FF&
BackStyle = 1 'Opaque
BorderColor = &H000000FF&
FillColor = &H00000080&
Height = 255
Left = 3480
Shape = 3 'Circle
Top = 2880
Width = 255
End
Begin VB.Label lblIP
BackStyle = 0 'Transparent
Caption = "IP:"
Height = 255
Left = 1710
TabIndex = 11
Top = 2910
Width = 255
End
Begin VB.Label lblPort
BackStyle = 0 'Transparent
Caption = "Port:"
Height = 255
Left = 0
TabIndex = 9
Top = 2905
Width = 375
End
Begin VB.Line lneSep3
BorderColor = &H80000003&
Index = 1
X1 = 3350
X2 = 3350
Y1 = 2400
Y2 = 2810
End
Begin VB.Line lneSep3
BorderColor = &H00FFFFFF&
Index = 0
X1 = 3360
X2 = 3360
Y1 = 2400
Y2 = 2820
End
Begin VB.Line lneSep2
BorderColor = &H80000003&
Index = 1
X1 = 1680
X2 = 1680
Y1 = 2790
Y2 = 2390
End
Begin VB.Line lneSep
BorderColor = &H80000003&
Index = 1
X1 = 0
X2 = 3360
Y1 = 2790
Y2 = 2790
End
Begin VB.Line lneSep2
BorderColor = &H00FFFFFF&
Index = 0
X1 = 1690
X2 = 1690
Y1 = 2805
Y2 = 2400
End
Begin VB.Line lneSep
BorderColor = &H00FFFFFF&
Index = 0
X1 = 0
X2 = 3360
Y1 = 2805
Y2 = 2805
End
Begin VB.Label lblNick
BackStyle = 0 'Transparent
Caption = "Nick: "
Height = 255
Left = 0
TabIndex = 5
Top = 2490
Width = 495
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**********************************************************
'* IP Chat by Joseph Huntley *
'* joseph_huntley@email.com *
'* http://joseph.vr9.com *
'* *
'* Made: October 4, 1999 *
'* Level: Intermediate *
'**********************************************************
'* Notes: None *
'**********************************************************
Private Const vbDarkRed = &H80&
Private Const vbDarkGreen = &H8000&
Private Sub cmdSend_Click()
''Send text to other person and print it into our textbox
sckConnect.SendData txtNick.Text & ":" & vbTab & txtText.Text
txtChat.Text = txtChat.Text & txtNick.Text & ":" & vbTab & txtText.Text & vbCrLf
''clear textbox
txtText.Text = ""
''show bottom half of textbox
txtChat.SelStart = Len(txtChat.ytext)
txtChat.SelLength = 0
End Sub
Private Sub sckConnect_Close()
cmdConnect_Click 'Reset everything
End Sub
Private Sub sckConnect_Connect()
txtChat.Text = txtCha